package com.stars.services.impl.system;
import com.github.pagehelper.PageInfo;
import com.stars.entity.system.SystemPerOrgEntity;
import com.stars.services.system.SystemPerOrgAccessServices;
import com.stars.dao.mapper.system.SystemPerOrgMapper;
import com.stars.entity.dto.system.SystemPerOrgDTO;

import java.util.List;
import com.stars.entity.ListPage;
import com.github.pagehelper.PageHelper;
import com.stars.services.impl.BaseAccessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: 资源与组织关系 业务逻辑
 * @author dj
 * @date 2019-10-17 20:57:37
 * @version V1.0
 *
 */
@Service
public class SystemPerOrgAccessServicesImpl  extends BaseAccessServiceImpl<SystemPerOrgMapper , SystemPerOrgEntity> implements  SystemPerOrgAccessServices {
    @Autowired
    private SystemPerOrgMapper  systemPerOrgMapper;


    /**
     * 分页查询
     * @param pageNum 查询参数 起始页，大小。
     * @return
     */
    @Override
    public PageInfo<SystemPerOrgDTO> pageList(Integer pageNum, Integer pageSize, SystemPerOrgDTO dto) throws Exception{
        ListPage<SystemPerOrgDTO> listPage = new ListPage<>(pageNum, pageSize, dto);
        PageHelper.startPage(pageNum, pageSize);
        List<SystemPerOrgDTO> list = systemPerOrgMapper.pageQuerySystemPerOrg(listPage);
        PageInfo<SystemPerOrgDTO> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
